package cn.itcast.nems.base.web.controller.b;

import cn.itcast.nems.base.dto.ProvinceDto;
import cn.itcast.nems.oldems.service.GeoService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/b/geo")
@RequiredArgsConstructor
public class GeoController {

    private final GeoService geoService;

    @RequestMapping("/list/full")
    public ResponseEntity<List<ProvinceDto>> listFull() throws Exception {
        return ResponseEntity.ok(geoService.listProvinceAndCities());
    }

}
